<?php
namespace Plugin\Attractions\AttractionManagement\Schema\Attraction;

use Plugin\Attractions\AttractionManagement\Model\Attraction\Attraction;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 景区表
 */
#[Schema(title: 'AttractionSchema')]
class AttractionSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'name', title: '景区名称', type: 'varchar')]
    public string $name;

    #[Property(property: 'intro_title', title: '景区介绍标题', type: 'varchar')]
    public string $intro_title;

    #[Property(property: 'intro', title: '景区介绍', type: 'longtext')]
    public string $intro;

    #[Property(property: 'cover_id', title: '封面Id', type: 'varchar')]
    public string $cover_id;

    #[Property(property: 'address', title: '地址', type: 'varchar')]
    public string $address;

    #[Property(property: 'phone', title: '联系电话', type: 'varchar')]
    public string $phone;

    #[Property(property: 'open_time', title: '开门时间', type: 'varchar')]
    public string $open_time;

    #[Property(property: 'close_time', title: '关门时间', type: 'varchar')]
    public string $close_time;

    #[Property(property: 'status', title: '状态1-正常 2-关闭', type: 'int')]
    public string $status;

    #[Property(property: 'created_at', title: 'created_at', type: 'datetime')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'datetime')]
    public string $updated_at;




    public function __construct(Attraction $model)
    {
       $this->id = $model->id;
       $this->name = $model->name;
       $this->intro_title = $model->intro_title;
       $this->intro = $model->intro;
       $this->cover_id = $model->cover_id;
       $this->address = $model->address;
       $this->phone = $model->phone;
       $this->open_time = $model->open_time;
       $this->close_time = $model->close_time;
       $this->status = $model->status;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'name' => $this->name ,'intro_title' => $this->intro_title ,'intro' => $this->intro ,'cover_id' => $this->cover_id ,'address' => $this->address ,'phone' => $this->phone ,'open_time' => $this->open_time ,'close_time' => $this->close_time ,'status' => $this->status ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at];
    }
}